window.onload = function  () {
	
	
	list = document.getElementsByClassName("list");

	item = document.getElementsByClassName('item');

	time = setInterval(run, 1000);

	num = 0;
	function run () {
		for (var i = 0; i < list.length; i++) {
			list[i].style.display="none";
			item[i].style.backgroundColor="red";
		};

		list[num].style.display="block";
		item[num].style.backgroundColor="#fff";

		if(num==(list.length-1)){
			num=0;
		}else{
			num++;
		}

	}

	banner = document.getElementById('banner');


	banner.onmouseover = function  () {
		clearInterval(time)
	}

	banner.onmouseout = function  () {
		time = setInterval(run, 1000);
	}


	for (var k = 0; k < item.length; k++) {
		click_run(k);
	};

	function click_run (a) {
		item[a].onclick = function  () {
			num=a;
			run();
		}
	}

	cilck_left = document.getElementById('cilck_left');

	cilck_right = document.getElementById('cilck_right');

	cilck_right.onclick = function () {
		run();
	}


	cilck_left.onclick = function () {
		if(num==1){
			num = item.length-1;
		}else if(num==0){
			num = item.length-2;
		}else{
			num-=2;
		}
		run();
	}
















}